enyo.kind({
	name: "enyo.CreateAssessmentResult",
	kind: enyo.PanelBase,
	
	components: [
		{kind: "PanelContent", headerContent: "Request Result", onSignOut: "doSignOut", submitLeftContent: "Back to Home", onSubmitLeft: "submitLeft", flex: 1, components: [
			{className: "margin-medium", components: [
				{kind:"HtmlContent", name: "messageContent", content : "", className: "divider-content italic bold"}, 
				{kind : "DividerDrawer", caption : "New Request ID", components : [
					{name: "requestIdContent", content : "", className: "divider-content italic bold"}, 
				]},
				{kind : "DividerDrawer", caption : "Request Type", components : [
					{name: "requestTypeContent", content : "", className: "divider-content"}, 
				]},
				{kind : "DividerDrawer", caption : "Notification Recipients", components : [
					{name: "recipientsContent", kind:"HtmlContent", content : "", className: "divider-content"}, 
				]},
			]}
		]}
	],
	
	create: function() {
		this.inherited(arguments);
		this.initPanel();
	},
	
	initPanel: function()
	{
		this.showScrim();
		
		if(enyo.Data.runImmediality && enyo.Data.saveSubscription) {
			this.$.messageContent.setContent("Subscription saved and it will run immediality!");
		} else if(enyo.Data.runImmediality) {
			this.$.messageContent.setContent("Request submitted and it will run immediality!");
		} else if(enyo.Data.saveSubscription) {
			this.$.messageContent.setContent("Subscription saved!");
		}
		
		this.$.requestIdContent.setContent(enyo.Data.newRequestID);
		
		//Show Type
		this.$.requestTypeContent.setContent(enyo.Data.selected_AnalysisTypePayload.defaultAnalysisTypeName);
		
		//Sow Recipients
		var recipientList = "";
		for(var i = 0; i < enyo.Data.notificationRecipients.length; i++) {
			recipientList += "<div class=\"break-all\">" + enyo.Data.notificationRecipients[i] + "; </div>";
		}
		this.$.recipientsContent.setContent(recipientList);
		
		this.hideScrim();
	},
	
	submitLeft: function() {
		this.parentWnd.switchView("home");
	}
});